 //! @Author: DengLibin
 //! @Date: Create in 2024-11-05 10:52:37
 //! @Description: 
mod test{
    use rust_my_tools::dao::sqlite::sqlite_dao;


    use tokio::runtime::Builder;
    fn cre_runtime() -> tokio::runtime::Runtime {
        // 创建一个 Tokio 运行时，配置线程池的大小
        Builder::new_multi_thread()
            .worker_threads(1) // 设置工作线程的数量
            .max_blocking_threads(16) // 设置阻塞任务的最大线程数
            .enable_all()
            .build()
            .unwrap()
    }
    #[test]
    pub fn test_create_table(){
        let r  =cre_runtime();
        r.block_on(async{
            let pool = sqlite_dao::get_conn_pool(r"sqlite:C:\Users\denglibin\Desktop\test.db").await.unwrap();
            let _  = sqlite_dao::create_tabale_demo(&pool).await.unwrap();
        });
    }
    #[test]
    pub fn test_add(){
        let r  =cre_runtime();
        r.block_on(async{
            let pool = sqlite_dao::get_conn_pool(r"sqlite:C:\Users\denglibin\Desktop\test.db").await.unwrap();
            let _  = sqlite_dao::add_demo(&pool).await.unwrap();
        });
    }
    #[test]
    pub fn test_select(){
        let r  =cre_runtime();
        r.block_on(async{
            let pool = sqlite_dao::get_conn_pool(r"sqlite:C:\Users\denglibin\Desktop\test.db").await.unwrap();
            let _  = sqlite_dao::select_demo(&pool).await.unwrap();
        });
    }
}